@REM **01** prerequisite prepare
@IF EXIST %~dp0../prerequisite.bat (
	@ECHO [#^| HEAD ] PREREQUISITE ^>- %~dp0..\prerequisite.bat
	CMD /C %~dp0../prerequisite.bat
	@ECHO [#^| TAIL ] PREREQUISITE ^>- %~dp0..\prerequisite.bat
)

@REM set the compile env
@REM compiler_default
@IF NOT DEFINED COMPILER_DEFAULT_PATH (
	@CALL vcvars64.bat

	@SET COMPILER_DEFAULT_PATH=loaded
)
@ECHO ^<%COMPILER_DEFAULT_PATH%^> COMPILER_DEFAULT_PATH

@REM **02** prepare for make
@ECHO :\____/:
@ECHO preparing
@IF EXIST %~dp0../config_local.mk (
	cat %~dp0config_part1.mk %~dp0../config_local.mk %~dp0config_part2.mk > %~dp0config_joint.mk
) ELSE (
	cat %~dp0config_part1.mk %~dp0config_part2.mk > %~dp0config_joint.mk
)
@IF EXIST %~dp0avoidremake DEL /F %~dp0avoidremake

@REM **03** make
@make -f %~dp0config_joint.mk %*